﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ShapeExer
{
    internal class Rectangle:IShape//矩形
    {
        double x;//长
        double y;//宽
        double area;//面积字段

        public Rectangle(double x,double y)//构造函数
        {
            this.x = x;
            this.y = y;
        }
        public double Area//面积属性
        {
            get
            {
                return x * y;
            }
            set
            {
                area = value;
            }
        }
        public bool isArealegal()//判断形状是否合法
        {
            if (Area > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
